package base.day23;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class MyIo6 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("E:\\text\\e.txt");
        FileOutputStream fos=null;
        int b;
        while ((b=fis.read())!=-1){
            try {
            fos=new FileOutputStream("E:\\text\\f.txt",true);
                fos.write((char)b);
            }catch(Exception e){
                e.printStackTrace();
            }finally {
                if (fos!=null){
                    try {
                        fos.close();
                    }catch(Exception e){
                        e.printStackTrace();
                    }
                }else {
                    System.out.println("fos==null!!!");
                }
            }
        }
    }
}
